home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / netprog.zip / NETPROG.TAR / rpc.sun / timedate / date_proc.c next >
C/C++ Source or Header  |  1989-12-17  |  675b  |  38 lines

  1. /*
  2.  * dateproc.c - remote procedures; called by server stub.
  3.  */
  4.  
  5. #include    <rpc/rpc.h>    /* standard RPC include file */
  6. #include    "date.h"    /* this file is generated by rpcgen */
  7.  
  8. /*
  9.  * Return the binary date and time.
  10.  */
  11.  
  12. long *
  13. bin_date_1()
  14. {
  15.     static long    timeval;    /* must be static */
  16.     long        time();        /* Unix function */
  17.  
  18.     timeval = time((long *) 0);
  19.  
  20.     return(&timeval);
  21. }
  22.  
  23. /*
  24.  * Convert a binary time and return a human readable string.
  25.  */
  26.  
  27. char **
  28. str_date_1(bintime)
  29. long    *bintime;
  30. {
  31.     static char    *ptr;        /* must be static */
  32.     char        *ctime();    /* Unix function */
  33.  
  34.     ptr = ctime(bintime);        /* convert to local time */
  35.  
  36.     return(&ptr);        /* return the address of pointer */
  37. }
  38.